{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "names = [\"Albert\",\"John\",\"Richard\",\"Henry\",\"William\"]\n",
    "surnames = [\"Goodman\",\"Black\",\"White\",\"Green\",\"Joneson\"]\n",
    "salaries = [500*random.randint(10,30) for _ in range(10)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "def generate_random_person(names, surnames, salaries):\n",
    "    return {\"name\":random.sample(names,1)[0],\n",
    "            \"surname\":random.sample(surnames,1)[0],\n",
    "            \"salary\":random.sample(salaries,1)[0]}\n",
    "def generate_people(k):\n",
    "    return [generate_random_person(names, surnames, salaries) for _ in range(k)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 'Richard', 'salary': 7500, 'surname': 'Joneson'}"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "generate_random_person(names, surnames, salaries)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(generate_people(50),columns=[\"name\",\"surname\",\"salary\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>surname</th>\n",
       "      <th>salary</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Henry</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Henry</td>\n",
       "      <td>Black</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>William</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>John</td>\n",
       "      <td>Black</td>\n",
       "      <td>6000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Albert</td>\n",
       "      <td>White</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>William</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Green</td>\n",
       "      <td>12500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Albert</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Albert</td>\n",
       "      <td>Joneson</td>\n",
       "      <td>12500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Black</td>\n",
       "      <td>6000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>William</td>\n",
       "      <td>Green</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>William</td>\n",
       "      <td>Joneson</td>\n",
       "      <td>6000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>William</td>\n",
       "      <td>Joneson</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Green</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Henry</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Joneson</td>\n",
       "      <td>6000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>William</td>\n",
       "      <td>Green</td>\n",
       "      <td>8500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>John</td>\n",
       "      <td>Green</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>Henry</td>\n",
       "      <td>White</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>John</td>\n",
       "      <td>Joneson</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>Albert</td>\n",
       "      <td>Black</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>Richard</td>\n",
       "      <td>White</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Black</td>\n",
       "      <td>8500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>Henry</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>Henry</td>\n",
       "      <td>Black</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>John</td>\n",
       "      <td>Green</td>\n",
       "      <td>11500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>John</td>\n",
       "      <td>Black</td>\n",
       "      <td>8500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Albert</td>\n",
       "      <td>Green</td>\n",
       "      <td>11500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>John</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>John</td>\n",
       "      <td>White</td>\n",
       "      <td>11500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>William</td>\n",
       "      <td>White</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>John</td>\n",
       "      <td>White</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>Albert</td>\n",
       "      <td>Green</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>William</td>\n",
       "      <td>Green</td>\n",
       "      <td>6000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>William</td>\n",
       "      <td>Black</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>Henry</td>\n",
       "      <td>White</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>Albert</td>\n",
       "      <td>Black</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>John</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>Richard</td>\n",
       "      <td>White</td>\n",
       "      <td>11500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>Henry</td>\n",
       "      <td>Green</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>8500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>William</td>\n",
       "      <td>White</td>\n",
       "      <td>11500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>John</td>\n",
       "      <td>Black</td>\n",
       "      <td>12500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>John</td>\n",
       "      <td>Green</td>\n",
       "      <td>7500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>Richard</td>\n",
       "      <td>Joneson</td>\n",
       "      <td>8500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>William</td>\n",
       "      <td>Goodman</td>\n",
       "      <td>9500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>William</td>\n",
       "      <td>White</td>\n",
       "      <td>6000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>Albert</td>\n",
       "      <td>Black</td>\n",
       "      <td>7000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>William</td>\n",
       "      <td>Green</td>\n",
       "      <td>12500</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       name  surname  salary\n",
       "0     Henry  Goodman    7500\n",
       "1     Henry    Black    9500\n",
       "2   William  Goodman    7000\n",
       "3      John    Black    6000\n",
       "4    Albert    White    9500\n",
       "5   William  Goodman    7500\n",
       "6   Richard    Green   12500\n",
       "7    Albert  Goodman    7500\n",
       "8    Albert  Joneson   12500\n",
       "9   Richard    Black    6000\n",
       "10  William    Green    7500\n",
       "11  William  Joneson    6000\n",
       "12  William  Joneson    7500\n",
       "13  Richard    Green    7000\n",
       "14    Henry  Goodman    9500\n",
       "15  Richard  Joneson    6000\n",
       "16  William    Green    8500\n",
       "17     John    Green    7500\n",
       "18    Henry    White    9500\n",
       "19     John  Joneson    7000\n",
       "20   Albert    Black    7500\n",
       "21  Richard    White    7500\n",
       "22  Richard    Black    8500\n",
       "23    Henry  Goodman    7500\n",
       "24    Henry    Black    7000\n",
       "25     John    Green   11500\n",
       "26     John    Black    8500\n",
       "27   Albert    Green   11500\n",
       "28     John  Goodman    7500\n",
       "29     John    White   11500\n",
       "30  William    White    7000\n",
       "31     John    White    9500\n",
       "32   Albert    Green    9500\n",
       "33  William    Green    6000\n",
       "34  William    Black    7000\n",
       "35    Henry    White    7000\n",
       "36   Albert    Black    7000\n",
       "37     John  Goodman    7500\n",
       "38  Richard    White   11500\n",
       "39  Richard  Goodman    7000\n",
       "40    Henry    Green    7500\n",
       "41  Richard  Goodman    8500\n",
       "42  William    White   11500\n",
       "43     John    Black   12500\n",
       "44     John    Green    7500\n",
       "45  Richard  Joneson    8500\n",
       "46  William  Goodman    9500\n",
       "47  William    White    6000\n",
       "48   Albert    Black    7000\n",
       "49  William    Green   12500"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
